{include file='common/head.html'}

<div class="layui-body">
    {if([$list])}
    <div class="layui-tab layui-tab-brief" lay-filter="tab">
        <ul class="layui-tab-title">
            <li class="layui-this" lay-id="t1">排单设置</li>
            <li lay-id="t2">排单利润列表</li>
            <li lay-id="t3">排单利润</li>

        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form action="{url./admin/Scheduling/index}" method="post" class="layui-form">
                    <input type="hidden" name="formcheck" value="{$formcheck}" >
                    <div class="layui-form-item">
                        <label class="layui-form-label">排单标题</label>
                        <div class="layui-input-block">
                            <input type="text" name="Scheduling_name" value="{$Scheduling->Scheduling_name}" placeholder="请输入站点标题"  class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">排单金额</label>
                        <div class="layui-input-inline">
                            <input type="text" name="Scheduling_amount"  placeholder="￥"value="{$Scheduling->Scheduling_amount}" placeholder="请输入排单金额"  class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">剩余金额</label>
                        <div class="layui-input-inline">
                            <input type="text" name="Scheduling_current_amount"  placeholder="￥"value="{$Scheduling->Scheduling_current_amount}"  disabled readonly class="layui-input layui-disabled">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">抢购比例</label>
                        <div class="layui-input-inline">
                            <input type="text" name="chance"  value="{$Scheduling->chance}" placeholder="请输入排单金额"  class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">数量</label>
                        <div class="layui-input-inline">
                            <input type="text" name="number"  value="{$Scheduling->number}" placeholder=""  class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">最小额度</label>
                            <div class="layui-input-inline">
                                <input type="text" name="minimum" autocomplete="off" value="{$Scheduling->minimum}" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">最大金额</label>
                            <div class="layui-input-inline">
                                <input type="text" name="largest" autocomplete="off" value="{$Scheduling->largest}" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">排单等级</label>
                        <div class="layui-input-inline">
                            <select name="Scheduling_group" lay-verify="required" lay-search="">

                                <option value="0"{if([$Scheduling->Scheduling_group]==0)}selected{/if}>所有会员</option>
                                {foreach $groups(key,value)}
                                <option value="[value->gcode]"{if([$Scheduling->Scheduling_group]==$value->gcode)}selected{/if}>[value->gname]</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">排单状态</label>
                        <div class="layui-input-block">
                            <input type="radio" name="Scheduling_state" value="1" title="未开始排单" {if([$Scheduling->Scheduling_state]==1)}checked="" {/if} {if([$Scheduling->Scheduling_state]!=1)}disabled=""{/if}>
                            <input type="radio" name="Scheduling_state" value="2" title="正在排单" {if([$Scheduling->Scheduling_state]==2)}checked=""{/if} {if([$Scheduling->Scheduling_state]!=2)}disabled=""{/if}>
                            <input type="radio" name="Scheduling_state" value="3" title="结束排单" {if([$Scheduling->Scheduling_state]==3)}checked=""{/if}  {if([$Scheduling->Scheduling_state]!=3)}disabled=""{/if}>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">开始时间</label>
                            <div class="layui-input-inline">
                                <input type="text" name="Scheduling_StartTime" value="{$Scheduling->Scheduling_StartTime}"  readonly placeholder="请选择开始时间"  class="layui-input datetime">

                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">结束时间</label>
                            <div class="layui-input-inline">
                                <input type="text" name="Scheduling_EndTime"  readonly placeholder="请选择结束时间"  value="{$Scheduling->Scheduling_EndTime}" class="layui-input datetime">

                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit>立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>

                </form>
            </div>

            <div class="layui-tab-item ">



                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th><input type="checkbox" class="checkbox" lay-ignore id="checkall" title="全选"></th>
                            <th>编号</th>
                            <th>排单天数</th>
                            <th>结算利润</th>
                            <th>最小投资额</th>
                            <th>状态</th>
                            <th>添加时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach $profit(key,value)}
                        <tr>
                            <td>
                                <input type="checkbox" class="checkbox checkitem" lay-ignore name="list[]"
                                       value="[value->id]">
                                <input type="hidden" name="listall[]" value="[value->id]">
                            </td>
                            <td>[value->id]</td>
                            <td>[value->buy_days]天</td>
                            <td>[value->Settlement_profits]%</td>
                            <td>[value->Minimum_amount]￥</td>
                            <td>
                                {if($value->status)}
                                <a href="{url./admin/Scheduling/mod/id/'.$value->id.'/field/status/value/0}"><i class='fa fa-toggle-on' title="点击禁用"></i></a>
                                {else}
                                <a href="{url./admin/Scheduling/mod/id/'.$value->id.'/field/status/value/1}"><i class='fa fa-toggle-off' title="点击启用"></i></a>
                                {/if}
                            </td>
                            <td>[value->add_time]</td>
                            <td>

                                {fun=get_btn_del($value->id)}
                                {fun=get_btn_mod($value->id)}
                            </td>
                        </tr>

                        {/foreach}
                        </tbody>
                    </table>

                <div class="page">{$pagebar}</div>
            </div>


            <div class="layui-tab-item">
                <form action="{url./admin/Scheduling/single_profit}" method="post" class="layui-form">
                    <input type="hidden" name="formcheck" value="{$formcheck}">


                    <div class="layui-form-item">
                        <label class="layui-form-label">排单天数</label>
                        <div class="layui-input-inline">
                            <input type="text" name="buy_days"  placeholder="请输入排单天数" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">结算利润</label>
                            <div class="layui-input-inline" style="width: 100px;">
                                <input type="text" name="Settlement_profits" placeholder="%" autocomplete="off" class="layui-input">
                            </div>

                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">最小排单额</label>
                            <div class="layui-input-inline" style="width: 100px;">
                                <input type="text" name="Minimum_amount"  value="" placeholder="￥" autocomplete="off" class="layui-input">
                            </div>

                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">是否启用</label>
                        <div class="layui-input-block">
                            <input type="radio" name="status" value="1" title="启用" checked>
                            <input type="radio" name="status" value="0" title="禁用">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit>立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>

        </div>
    </div>
    {/if}
    {if([$mod])}
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">排单修改</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form action="{url./admin/Scheduling/mod/id/'.[$get.id].'}{$backurl}" method="post" class="layui-form">
                    <input type="hidden" name="formcheck" value="{$formcheck}" >
                    <div class="layui-form-item">
                        <label class="layui-form-label">排单天数</label>
                        <div class="layui-input-inline">
                            <input type="text" name="buy_days"  value="{$profit->buy_days}" placeholder="请输入排单天数" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">结算利润</label>
                            <div class="layui-input-inline" style="width: 100px;">
                                <input type="text" name="Settlement_profits"  value="{$profit->Settlement_profits}" placeholder="%" autocomplete="off" class="layui-input">
                            </div>

                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">最小排单额</label>
                            <div class="layui-input-inline" style="width: 100px;">
                                <input type="text" name="Minimum_amount"  value="{$profit->Minimum_amount}" placeholder="￥" autocomplete="off" class="layui-input">
                            </div>

                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">是否启用</label>
                        <div class="layui-input-block">
                            <input type="radio" name="status" value="1" title="启用" {if([$profit->status]==1)}checked{/if}>
                            <input type="radio" name="status" value="0" title="禁用" {if([$profit->status]==0)}checked{/if}>

                        </div>
                    </div>


                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit>立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            {fun=get_btn_back()}
                        </div>
                    </div>

                </form>
            </div>
        </div>
    </div>
    {/if}
</div>
<script>
    //日期
    laydate.render({
        elem: '#start'
    });
    laydate.render({
        elem: '#end'
    });

</script>
{include file='common/foot.html'}
